function fib(n)
{
    if(n<2)
        return n;
    else
        return fib(n-2)+fib(n-1);
}
var N=40;
var start=new Date().getTime();
console.log("计算结果："+fib(N)+"</br>");
var end =new Date().getTime();
console.log("计算"+N+"个斐波那契数列耗时："+(end-start)/1000.0+"秒");